<html>
  
  <head>

    <title>Barad - demo instructions</title>

    <style type="text/css">
      body {font:76% Arial,sans-serif;}
    </style>

  </head>
  
  <body>
    
    <h2>Barad - demo instructions</h2>
    
    <p>
      <h3>Introduction</h3> 
      This document provides instructions for running a simple example that demonstrates the basic functionality of the Concrete Agent of the Barad GUI testing tool.
      The Concrete Agent generates tests adopting a traditional test generation approach and executes tests on the application under test (AUT). In contrast with
      conventional GUI testing frameworks which restart the GUI after executing a test case, the agent reinitializes the AUT. The agent uses a client-server architecture.
      It is a JVM Tool Interface (JVMTI) and can detect defects via uncaught exceptions thrown by the AUT at runtime.</br> 
    </p>
    
    <h3>Content</h3> 
    
    <p>
      This <a href="BaradDemo.zip">archive</a> contains a complete example of how the concrete agent of Barad is used for testing GUI of applications written with the SWT library. The goal of this demo
      is to give an overview of how the GUI testing process is accomplished and uses as a subject a set of simple GUI applications. The archive contains the following files:</br>
        
     </br>  
   
     <table border="1" cellpadding="5" style="font:90% Arial,sans-serif;">
        <tr>
          <td><b>File name</b></td>
          <td><b>Description</b></td>
        </tr>  
        <tr>
          <td>guitestingdemos.jar</td>
          <td>Contains the subject applications</td>
        </tr>  
        <tr>
          <td>baradstudio.jar</td>
          <td>Client that controls the testing process</td>
        </tr> 
        <tr>
          <td>baradagent.jar</td>
          <td>Server that performs the testing process</td>
        </tr>
        <tr>
          <td>BaradAgent.dll</td>
          <td>JVMTI agent that starts the test server</td>
        </tr>
        <tr>
          <td>TestSpecification.xml</td>
          <td>Specification with user inputs</td>
        </tr>
        <tr>
          <td>lib</td>
          <td>Folder with third party libraries</td>
        </tr>
        <tr>
          <td>BaradStudio.bat</td>
          <td>Batch script that starts the test client</td>
        </tr>
        <tr>
          <td>SimpleCalculator.bat</td>
          <td>Batch script that starts the first example</td>
        </tr>
        <tr>
          <td>SimpleCalculator$$SaveToDB.bat</td>
          <td>Batch script that starts the second example</td>
        </tr>
        <tr>
          <td>SimpleCalculator$$WithValidation.bat</td>
          <td>Batch script that starts the third example</td>
        </tr>
      </table>
         
      </br>
        
    </p>

    <h3>Examples</h3>

    <p>
      This section provides step by step instructions on how to run each of the three examples in this demo. Each example is a GUI application which is tested with our tool.
      These applications represent iterative development of a GUI and aim to demonstrate how our tool generates, executes, evaluates, and reuses test cases. By reuse of test
      cases we mean utilizing of tests generated for a version of the GUI which has fewer features for another version which has additional features. Detailed descriptions of
      our test reuse techique can be found <a href="TestingOfGUIProductLines.pdf">here</a>. A description of the Barad GUI testing framework can be found <a href="ISSREBarad2008.pdf">here</a> and <a href="Master's Report [Author, Chip Killmar].pdf">here</a>. To run the
      examples included in this demo unzip the <a href="BaradDemo.zip">archive</a> and follow the instructions below:</br>
    </p> 

    
    <h4>Example 1 - Simple Calculator</h4>

    <p>
      The GUI presented in this example is an application (202 lines of code) that we developed. It calculates the unit price rounded to the closest integer given a total amount and
      quantity. This version of the GUI represents the base program. No validity checks are performed for the inputs in the total amount and quantity fields, which accept integer values.
      Hence, it is possible to enter an unrealistic negative value as a total amount or quantity. Note that the Rounded unit price text box is read only. To run this example do the following steps:</br></br>
      
      1. Run BaradStudio.bat</br>
      2. Run SimpleCalculator.bat</br>
      3. In Barad Studio select 'Connect'</br>
      4. Go to the 'Test Cases' tab</br>
      5. Unselect the checkbox 'Source test file'</br> 
      6. Select the 'Play' button</br>
      7. Explore the results in the 'Results' section</br>
      8. Close the console windows of the Simple Calculator and Barad Studio</br>
  
      </br>

      <img src="SimpleCalculatorExample.png">
      
      </br></br>

      After running this examples the tests generated for the GUI will be stored in the file 'TestFile.gt'
    </p>

    <h4>Example 2 - Persisting Calculator</h4>

    <p>
      The GUI presented in this example is the Persisting Calculator. It is generated by composing the Simple Calculator (i.e. the base program) with a persistence feature. The persistence feature
      mimics the functionality of saving the calculation result. This feature is composed of a single button, selecting of which performs a void action, simulating a non-interacting feature,i.e. the
      new functionality does not interact with the previous. Hence, the Persisting Calculator is a composition of the base program with an orthogonal feature. To run this example do the following steps:</br></br>
     
      1. Run BaradStudio.bat</br>
      2. SimpleCalculator$$SaveToDB.bat</br>
      3. In Barad Studio select 'Connect'</br>
      4. Go to the 'Test Cases' tab</br>
      5. Unselect the checkbox 'Destination test file'</br> 
      6. Select the 'Play' button</br>
      7. Explore the results in the 'Results' section</br>
      8. Close the console windows of the Persisting Calculator and Barad Studio</br>
         
     </br>
     
     <img src="PersistingCalculatorExample.png">

     </br></br>

      After running this examples the tests generated for the Simple Calculator are reused and new tests that cover the added functionality are generated.
    </p>

    <h4>Example 3 - Validating Calculator</h4>

    <p>
      The GUI presented in this example is the Validating Calculator. The application has the same structure as the Simple Calculator in the first example The Validating Calculator is composed of the 
      Simple the base program and a validation feature. The Simple Calculator has two text boxes that accept any numeric value. The validation feature ensures that only non-negative values are populated 
      in the Total amount and Quantity fields. Note that the validation feature interacts with the Simple Calculator by changing the valid inputs for its data widgets. To run this example do the following steps:</br></br>
    
      1. Run BaradStudio.bat</br>
      2. SimpleCalculator$$SaveToDB.bat</br>
      3. In Barad Studio select 'Connect'</br>
      4. Go to the 'Test Cases' tab</br>
      5. Unselect the checkbox 'Destination test file'</br> 
      6. Select the 'Play' button</br>
      7. Explore the results in the 'Results' section</br>
      8. Close the console windows of the Persisting Calculator and Barad Studio</br>
         
     </br>
     
     <img src="PersistingCalculatorExample.png">

     </br></br>

      After running this examples the tests generated for the Simple Calculator are reused and new tests that cover the added functionality are generated.
    </p>

    <h4>Example 3 - Error detection</h4>

    <p>
      The GUI presented in this example is the Validating Calculator. The application has the same structure as the Simple Calculator in the first example The Validating Calculator is composed of the 
      Simple the base program and a validation feature. The Simple Calculator has two text boxes that accept any numeric value. The validation feature ensures that only non-negative values are populated 
      in the Total amount and Quantity fields. Note that the validation feature interacts with the Simple Calculator by changing the valid inputs for its data widgets. To run this example do the following steps:</br></br>
    
      1. Open TestSpecification.xml</br> and replace "<entry key="edu.utexas.barad.agent.swt.proxy.widgets.TextProxy">-1, 10</entry>" with <entry key="edu.utexas.barad.agent.swt.proxy.widgets.TextProxy">-1, 0, 10</entry> </br>
      2. Run SimpleCalculator.bat</br>
      3. In Barad Studio select 'Connect'</br>
      4. Go to the 'Test Cases' tab</br>
      5. Unselect the checkbox 'Destination test file'</br> 
      6. Select the 'Play' button</br>
      7. Explore the results in the 'Results' section</br>
      8. Close the console windows of the Persisting Calculator and Barad Studio</br>
         
     </br>
     
     <img src="PersistingCalculatorExample.png">

     </br></br>

      After running this examples the tests generated for the Simple Calculator some of errors will be detected by the tool. The errors will be reported in the 'Exceptions' tab of the 'Results' section.
    </p>

  </body>

</html>





















